﻿@*
    For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
*@
@{
    Layout = null;
}


<script src="~/lib/layui/layui.js"></script>
<link href="~/lib/layui/css/layui.css" rel="stylesheet" />

<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script>
<link href="~/lib/layui/css/layui.css" rel="stylesheet" />
<script src="~/lib/layui/layui.js"></script>
<script src="~/js/js.cookie.js"></script>
<script src="~/js/moment.js"></script>
<script src="~/lib/jquery/dist/jquery.js"></script>
<script src="//unpkg.com/layui@2.9.20/dist/layui.js"></script>

<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">顺序编号</label>
        <div class="layui-input-inline">
            <div class="layui-input-inline" style="width: 100px;">
                <input type="number" name="price_min" placeholder="" autocomplete="off" class="layui-input" min="0" step="1" lay-affix="number" id="orderid">
            </div>
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">材料URL</label>
        <div class="layui-input-inline">
            <input type="text" name="input2" placeholder="请输入" autocomplete="off" class="layui-input" id="materialURl">
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">辅助设备</label>
        <div class="layui-input-inline">
            <input type="text" name="input1" placeholder="请输入" autocomplete="off" class="layui-input" id="auxiliaryEquipment">
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">辅助材料</label>
        <div class="layui-input-inline">
            <input type="text" name="input2" placeholder="请输入" autocomplete="off" class="layui-input" id="materialF">
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">步骤说明</label>
        <div class="layui-input-inline">
            <textarea name="" placeholder="多行文本框" class="layui-textarea" id="mEss"></textarea>
        </div>
    </div>
</div>
<div class="layui-form-item">
    <div class="layui-inline">
        <label class="layui-form-label">备注</label>
        <div class="layui-input-inline">
            <textarea name="" placeholder="多行文本框" class="layui-textarea" id="stepDescription"></textarea>
        </div>
    </div>
</div>
<div class="layui-btn-container">
    <button type="button" class="layui-btn layui-btn-radius" onclick="ProceAdd()">修改</button>
</div>
<script>



    $(()=>{
        BackHtml()
    })
    //工序步骤修改
    function BackHtml() {
        var processid = location.href.split("=")[1];
        $.ajax({

            url: '@ViewBag.FoundationRead' + '/api/Production/StepDescriptionBack',
            data: JSON.stringify({ stepid:processid }),
            type: "post",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (res) {
                $("#orderid").val(res.data[0].orderid);
                $("#materialURl").val(res.data[0].materialURl);
                $("#auxiliaryEquipment").val(res.data[0].auxiliaryEquipment);
                $("#materialF").val(res.data[0].materialF);
                $("#stepDescription").val(res.data[0].stepDescription);
                $("#mEss").val(res.data[0].mEss);
            }
        })
    }


    function ProceAdd(){
        var processid = location.href.split("=")[1];
        var date = {
            orderid: $("#orderid").val(),
            materialURl: $("#materialURl").val(),
            auxiliaryEquipment: $("#auxiliaryEquipment").val(),
            materialF: $("#materialF").val(),
            stepDescription: $("#stepDescription").val(),
            Processtepid: processid,
            mEss: $("#mEss").val()
        };
        console.log(date);
        $.ajax({

            url: '@ViewBag.FoundationWrite' + '/api/Jocker/StepUpdate',
            data: JSON.stringify(date),
            type: "post",
            async: false,
            dataType: "json",
            contentType: "application/json",
            success: function (res) {
                if (res.code == 1) {
                    alert("修改成功");
                  
                }
            }
        })




    }




</script>
